/*
 * @Description:
 * @Autor: 刘诗文
 * @Date: 2020-11-10 09:44:23
 * @LastEditors: 马毅
 * @LastEditTime: 2021-07-07 20:10:00
 */
import axios from '@/api/fetch';
// import * as types from './types';
import SERVER from '@/api/server';

// 查询售后回访分派信息
// export const getAfterVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/customerCare/ownerVehicleManagement/getAfterVisitInfo`, { params });
export const getAfterVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/findAll`, { params });

// 查询售后回访结果信息
export const getVisitResultQuery = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/entryVisitResult/getVisitResultQuery`, { params });

// 问卷名称下拉框
export const getQuestionnaireList = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/entryVisitResult/getQuestionnaireList`, { params });

// 操作员、录入人
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
// 操作员、录入人
export const getNameByIds = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getNameByIds`, { params });

// 售后回访-任务分派
// export const taskAssignment = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/entryVisitResult/taskAssignment`, params);
export const taskAssignment = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/taskAssignment`, params);

// 售后回访分配excel导出
export const getAfterVisitInfoExcelList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/customerCare/ownerVehicleManagement/getAfterVisitInfo/export/excel`, { params, responseType: 'arraybuffer' });

// 查询售后回访录入信息
export const getVisitInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/visitInput`, { params });

export const getVisitHistory = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/activityVisitResult/getVisitHistory`, { params });
// 查询售后回访录入信息
export const getActivityEntryVisitResultHistory = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customerCare/activityVisitResult/getActivityEntryVisitResultHistory`, { params });

// 保存售后回访录入信息
export const visitInputSave = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/visitInputSave`, params);

// 查询售后回访历史信息
export const returnHistory = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/returnHistory`, { params });

// 查询服务活动列表
export const activityList = params => axios.post(`${SERVER.DMSCLOUD_ACTIVITY}/ttRpMa/searchDListRecord`, params);

// 售后回访分配excel导出
export const getAfterVisitInfoExport = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/export`, { params, responseType: 'blob' });

//查询问卷
export const getAskAndAnswer = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/getAskAndAnswer`, { params });

//查询问卷明细
export const getAskAndAnswerInfo = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/afterSales/returnVisit/getAskAndAnswerInfo`, { params });
